(in-package :netrisd)

(defmacro aif (test-form then-form &optional else-form)
  `(let ((it ,test-form))
     (if it ,then-form ,else-form)))

(defun string-to-list (str)
  (map 'list #'char-code str))

(defun list-to-string (lst)
  (map 'string #'code-char lst))


(defun first-n (num lst)
  (labels ((self (lst count acc)
		 (if (= count num)
		     (values (nreverse acc) lst)
		     (self (cdr lst) (1+ count) (cons (car lst) acc)))))
    (self lst 0 nil)))

